package net.sk.china.front.service.user;

import com.baomidou.mybatisplus.extension.service.IService;
import net.sk.china.common.model.user.UserAddress;
import net.sk.china.common.request.PageParamRequest;
import net.sk.china.front.request.user.UserAddressRequest;

import java.util.List;

/**
 * UserAddressService 接口
 * +----------------------------------------------------------------------
 * | Talk To [ 聊来改善地区金融服务环境，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2018-2024 聊来All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed ( <a href="http://www.apache.org/licenses/LICENSE-2.0">apache</a> )
 * +----------------------------------------------------------------------
 * | @Author: 聊来 <18970881148@qq.com>
 * +----------------------------------------------------------------------
 * | DateTime: 2024/6/12 21:37
 * +----------------------------------------------------------------------
 */
public interface UserAddressService extends IService<UserAddress> {

    /**
     * 地址列表
     * @param page 分页参数
     * @return {@code List<UserAddress>}
     */
    List<UserAddress> getList(PageParamRequest page);

    /**
     * 添加地址
     * @param request 地址请求参数
     * @return {@code UserAddress}
     */
    UserAddress create(UserAddressRequest request);

    /**
     * 删除用户地址
     * @param id 地址id
     * @return {@code boolean}
     */
    boolean delete(Integer id);

    /**
     * 获取地址详情
     * @param id 地址id
     * @return {@code UserAddress}
     */
    UserAddress getDetail(Integer id);

    /**
     * 获取默认地址
     * @return {@code UserAddress}
     */
    UserAddress getDefault();

    /**
     * 设置默认地址
     * @param id 地址id
     * @return {@code boolean}
     */
    boolean setDefault(Integer id);

    /**
     * 获取默认地址
     * @return {@code UserAddress}
     */
    UserAddress getDefaultByUid(Integer uid);
}
